home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: uu4news.netcom.com!zodiac!szh
- From: szh@zcon.com (Syed Zaeem Hosain)
- Subject: Re: division problem
- Message-ID: <1996Feb2.020615.26648@zcon.com>
- Sender: szh@zcon.com (Syed Zaeem Hosain)
- Nntp-Posting-Host: zodiac
- Reply-To: szh@zcon.com
- Organization: Z Consulting Group
- References: <823118692snz@genesis.demon.co.uk>
- Date: Fri, 2 Feb 1996 02:06:15 GMT
-
- In article <823118692snz@genesis.demon.co.uk>, Lawrence Kirby <fred@genesis.demon.co.uk> writes:
- >In article <4emuba$1mo@fountain.mindlink.net>
- > genew@mindlink.bc.ca "Gene Wirchenko" writes:
- >
- >>>Still no need to use floating point,
- >>>celcius = ((fahrenheit - 32) * 5 + 4) / 9
- >>
- >> Let's assume that you had never run across fahrenheit to celsius
- >>conversion before (because the above could just as easily be a case of
- >>converting flibbles to meeblesnauzers).
- >>
- >> Can you derive the ORIGINAL formula for conversion of F to C?
- >>
- >> If yes, how? Because you don't know what the 4 is for.
- >
- >Maybe not but its effect is clearly one of rounding. Perhaps it would be
- >clearer to specify it as (9/2), perhaps not.
- >
- >> If no, then it's unclear code, isn't it?
- >
- >How would you express it more clearly?
-
- How about commenting the code well? We seem to want to find obscure
- methods to do things in the language (whatever it may be) without using
- the simpler systems that already exist! :-)
-
- I tend to like applying the KISS rule.
-
- Z
-
-
- --
- -------------------------------------------------------------------------
- | Syed Zaeem Hosain P. O. Box 610097 (408) 441-7021 |
- | Z Consulting Group San Jose, CA 95161 szh@zcon.com |
- -------------------------------------------------------------------------
-